1. Technical Field
The present invention relates to a technique for calling and executing a program on a computer.
2. Related Art
Dynamic scripting languages such as PHP and more static programming languages such as Java® have been used as programming language processing and execution systems used in server environments. Recently, arrangements have been provided in which a dynamic scripting language program such as a PHP program declares a class of a static language platform such as Java® virtual machines or the Common Language Infrastructure (CLI) so that, for example, PHP programs can readily invoke class assets of Java® with untyped access to these classes enabled.
Since a Java® VM is a static programming environment a loaded class object remains in memory for a long period of time. In contrast, in a programming model of a dynamic language processing system such as PHP, in general, a period during which a loaded class object resides on a memory is relatively short.
Japanese Unexamined Patent Application Publication No. 2007-109044 relates to conversion of a program in which the process varies with the content of an argument to a program that can be readily analyzed and discloses a dedicated called program generation unit that detects a called program; each argument changing the process of the called program, and each content of the argument in a program group and generates a program for executing only a part of the process of the called program; the part corresponding to the content of the argument, as a dedicated called program for the argument and the content of the argument; a call position detection unit that detects a call position at which the called program is called from the program group; and a calling program rewriting unit that rewrites the call position so that the dedicated called program generated by the dedicated called program generation unit is called.
US 2008/0163167 A1 relates to a technique for executing a Java® object method invocation using a scripting language. There are disclosed a method for providing a unitary system for invoking a Java method from a Java access implementation of a scripting language and a technique for enabling field access by name.
Japanese Patent Application No. 2008-298346 describes a method for allowing handling of an unknown type object and allowing avoidance of an increase in overhead of execution, particularly as an application programming interface so as to provide a method for accessing an unknown type object at high speed. The programming interface includes a function capable of directly using a value in a field even when the type of the field to be accessed is a primitive type; a function capable of directly using a primitive type value even when the type of a parameter or a return value of a method to be called is a primitive type; and a function capable of generating runtime code specialized in a class of an object to be accessed. In the generated code, a designated method such as a getter/setter method is directly called.
In Project Zero development guide, it is disclosed that the PHP Java Bridge in WebSphere sMash can be used to interact with Java® objects, implement Java interfaces, and instantiate and extend Java classes. In the Project Zero development guide, code for invoking Java classes from PHP code is described. For example, the following exemplary code is shown:
<?php...$map = new Java(“java.util.HashMap”);$map->put(“title”,“Java Bridge”);...echo $map->get(“title”).“\n”;...?>
However, in the known art, a problem still exist in that, when dynamic access to a generated class object from a dynamic scripting language processing system such as PHP is enabled, access must be performed as a slow hash table access for each time and thus results in a bad execution performance, as described above.